﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace collabr8
{
    public partial class SizerForm : Form
    {
        private ServerForm father;
        private bool isOpen = false;
 
        public SizerForm()
        {
            InitializeComponent();
        }
        public SizerForm(ServerForm father)
        {
            InitializeComponent();
            this.father = father;
        }

        public void Open()
        {
            this.isOpen = true;
            this.Show();
        }

        private void SizerForm_MouseClick(object sender, MouseEventArgs e)
        {
            this.Close();
        }

        private void SizerForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.isOpen = false;
            father.IsUsingWindow = false;
            father.SelectedMethod = true;
            father.SetArea(this.Location.X+6, this.Location.Y+24, this.Width-12, this.Height-30);

            if (father.IsSharingScreen)
            {
                father.Invoke(father.delegateShareArea);
            }
        }

        public bool IsOpen
        {
            get 
            {
                return this.isOpen;
            }
        }
    }
}
